home *** CD-ROM | disk | FTP | other *** search
- Example Scripit Scripts
- -----------------------
-
- By: Khalid Aldoseri
-
-
- -----------------------------------------------------------------------------
- Example 1
- -----------------------------------------------------------------------------
-
- This is a script that shows you how to launch any program
- and do a set of actions:
-
- runback "full pathname"
- waitfor "program's screen name" "program's window name"
- menu MenuName MenuItem [SubItem]
- menu .... etc.
-
-
- Example:
-
- runback "dh2:Access/Access!"
- waitfor "Access"
- menu "Phone" "Re-Dial"
-
- Notes:
-
- The quotes are not important unless you have spaces or commas
- in the arguments.
-
- If you need to specify any CLI command switches when running
- the program use: runback "programname switches...."
-
- With Access, it's best if you wait for all its windows to
- appear on the screen, so you can either add a WAIT statement
- after the WAITFOR, or you can change the WAITFOR to become
- a (WAITFOR Access #4) This tell Scripit to wait until four
- windows show up on the Access screen.
-
- -----------------------------------------------------------------------------
- Example 2
- -----------------------------------------------------------------------------
-
- This is an expanded example of Example 1:
-
- runback "dh2:Access/Access!_Supra"
- waitfor Access #5
- menu Phone Re-Dial
- runback "dh2:Access/ShowModem -sAccess"
- waitfor Access "Supra Modem"
- window moveto 640 0
-
- The following is a full description of it:
- (all lines starting with ;; are comments and are ignored by Scripit.)
-
- ;; This Scripit script will load Access, tell it to start dialling
- ;; then run the Supra ShowModem program and move its window to
- ;; the top left corner of the screen.
- ;;
- ;; By: Khalid Aldoseri.
- ;;
- ;; Run Access
- ;; Replace this with the full path of where your copy of Access is.
- runback "dh2:Access/Access!_Supra"
- ;; Wait until all of Access's five windows show up.
- ;; Note: If you're not using the chat window change the
- ;; #5 to #4.
- waitfor Access #5
- ;; Tell Access to Re-Dial. i.e. dial first number in list.
- menu Phone Re-Dial
- ;; Run the Supra ShowModem program.
- ;; Replace this with the full path of where your ShowModem is.
- runback "dh2:Access/ShowModem -sAccess"
- ;; Wait until ShowModem's window shows up.
- waitfor Access "Supra Modem"
- ;; Move it to the top right corner of the screen.
- window moveto 640 0
- ;; Note: Remove the lines with ;; if you don't want them.
-
- -----------------------------------------------------------------------------
- Example 3
- -----------------------------------------------------------------------------
-
- This is a small script that expands the current CLI window, moves the cursor
- to the top, and then clears the whole window including its borders. This
- gives you a blank CLI with no borders.
-
- select active
- window moveto 0,0
- wait 10
- window maxsize
- wait 10
- con move 0,0
- gfx clear 0,0
-
-
- Here it is again with comments:
-
- ;; Select the active CLI.. normally the one it was started from
- select active
- ;; Move that window to the top left corner of the screen
- window moveto 0,0
- ;; Wait a while to make sure the window move operation is done
- wait 10
- ;; Resize the window to the maximum size possible
- window maxsize
- ;; Wait a while to make sure the window resize operation is done
- wait 10
- ;; Move the console cursor to the top
- con move 0,0
- ;; Clear the window's text/graphics starting from 0,0
- gfx clear 0,0
-
- -----------------------------------------------------------------------------
- Example 4
- -----------------------------------------------------------------------------
-
- Here's one the runs WordPerfect, resizes its window to fit half the screen,
- tells WP to open a new window, resizes that to half as well and moves it to
- the bottom of the screen, giving you WP ready for action with 2 windows
- ready. (grin)
-
- runback "WP:WP"
- waitfor Workbench WordPerfect
- window resizeto 640,100
- wait
- menu Project New
- waitfor Workbench "WordPerfect 4.1 - Doc 2"
- window resizeto 640,100
- wait
- window moveto 0,100
-
-
- Commented Version:
-
- ;; Run WordPerfect
- runback "WP:WP"
- ;; Wait for WP to show up on the Workbench screen
- waitfor Workbench WordPerfect
- ;; Resize WP's window to 640 by 100
- window resizeto 640,100
- ;; Wait until resize operation is done.
- ;; You might have to increase the wait time if this isn't
- ;; enough. (default wait is 25.. i.e. 1/2 second).
- wait
- ;; Select the menu 'Project' 'New' to open a new window.
- menu Project New
- ;; Wait until the second window shows up.
- waitfor Workbench "WordPerfect 4.1 - Doc 2"
- ;; Resize second window to 640,100
- window resizeto 640,100
- ;; Wait again.
- wait
- ;; Move the second window to 0,100.
- window moveto 0,100
-
- -----------------------------------------------------------------------------
- Example 5
- -----------------------------------------------------------------------------
-
- This is another WP example. This time, however, it runs WP then loads in
- a specific file.
-
-
- runback "WP:WP"
- waitfor Workbench WordPerfect
- menu Project "ยป Retrieve" File
- waitfor Workbench Retrieve
- ;; Simulate the user typing "RAM:Test". (replace this with your own filename)
- key "RAM:Test"
- ;; Click on the Accept gadget
- gadget Accept
-
-
- You can easily merge examples 4 and 5 together and make WP load up any
- number of files you like!
-
- -----------------------------------------------------------------------------
- Example 6
- -----------------------------------------------------------------------------
-
- Here's a script that'll load Professional Draw, bring up the file requester,
- enter the directory and filename and load the file:
-
-
- runback "PDraw:PDraw"
- waitfor "Professional Draw"
- wait
- menu Project Open
- wait
- select window "Open Folio"
- gadget Drawer "PDraw:Drawings"
- wait
- gadget File "HandFlyer"
-
- -----------------------------------------------------------------------------
- Example 7
- -----------------------------------------------------------------------------
-
- Here's another script that'll load Professional Page, and then will create
- a new page (ready for work.)
-
- runback "PDraw:PDraw"
- waitfor "Professional Draw"
- wait
- menu Page Create
- wait
- select window "New Page Format"
- gadget OK
-
- -----------------------------------------------------------------------------
- Well, that's it for now. I hope these are of some help to you. I'll be
- doing another set very soon. Any questions, comments, bug reports, curses,
- etc. are welcome.
-
- Khalid Aldoseri CIS 75166,2531 9 August 1989.
- -----------------------------------------------------------------------------
-